package com.nx.platform.es.system.filter;



import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;

import java.util.Map;


@Slf4j
public class ResponseFilter  {
//public class ResponseFilter implements IFilter {

//    @Override
//    public void filter(SCFContext scfContext) throws Exception {
//        try {
//
//            StopWatch stopWatch =scfContext.getStopWatch();
//            Map<String, StopWatch.PerformanceCounter> couterMap = stopWatch.getMapCounter();
//            StopWatch.PerformanceCounter couter = couterMap.get("dealES_filter");
//            couter.setEndTime(System.currentTimeMillis());
//            long exectime = couter.getEndTime() - couter.getStartTime();
//            long waittime = stopWatch.getExecuteTimeInMillis(StopWatch.MethodWaitTimeKey);
//            log.info("{}  exectime={} waittime={} totaltime={} desc=end", couter.getDescription(), exectime, waittime, exectime + waittime);
//            MDC.remove("logStr");
//
//        } catch (Throwable e) {
//            log.error("desc=ResponseFilter.filter", e);
//        }
//    }
//
//    @Override
//    public int getPriority() {
//        return 0;
//    }
}
